package com.ljw.miniweb.login.dao;

import java.sql.SQLException;
import java.util.List;


import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.ljw.miniweb.dbconn.MyAppSqlConfig;
import com.ljw.miniweb.exception.NoLoginException;
import com.ljw.miniweb.login.bean.LoginBean;


/**
name    : LoginDaoImpl
content : 
date    : 2011.02.12
author  : ljw

@author ljw(jwlee1728@gmail.com)
@version 1.0

* @see class_name : LoginDao
* @see class_name#method_name : "See also"
* @param name description :
* @return description :
* @exception class_name :
*/

@Repository("loginDao")
public class LoginDaoImpl implements LoginDao {
	
	Log logger = LogFactory.getLog(this.getClass());
	SqlMapClient sqlMap = MyAppSqlConfig.getSqlMapInstance();
	
	
	/**
	* Method getUser
	*
	* @param
	* @param
	* @return 
	*/
	public boolean getUser(String user_id, String user_pass) throws SQLException, NoLoginException{
		/*List<LoginBean> list = (List<LoginBean>)sqlMap.queryForList("getUser");
		
		LoginBean bean;
		for(int i = 0; i < list.size(); i++){
			bean = list.get(i);
			logger.info("test " + bean.getUser_nm());
		}*/
		
		//test 시나리오 user_id = jwlee1728 && user_pass=lee3319로 login시 정상으로 접근으로 본다.
		if(user_id.equals("jwlee1728") && user_pass.equals("lee3319"))
			return true;
		else
			return false;

	}
}
